package com.ty.service;

import cn.hutool.core.date.DateUtil;
import com.ty.entity.EmployeeQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ty.entity.Employee;
import com.ty.dao.EmployeeDao;
import com.ty.service.EmployeeService;

import java.util.List;

/**
 * 员工表;(212_employee)表服务实现类
 * @author : heimi
 * @date : 2025-6-11
 */
@Service
public class EmployeeService{
     
    @Autowired
    private EmployeeDao employeeDao;
    
    public List<Employee> select(EmployeeQuery query) {
        return employeeDao.select(query);
    }
    
    public Integer insert(Employee employee) {
        String employeeId = "10"+"_"+ DateUtil.format(DateUtil.date(),"yyyyMMhh");
        employee.setEmployeeId(employeeId);
        return employeeDao.insert(employee);
    }
    
    public Integer update(Employee employee) {
        return employeeDao.update(employee);
    }
    
    public Integer delete(Integer id) {
        return employeeDao.delete(id);
    }
    
}